{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "3b66c64f",
   "metadata": {},
   "outputs": [],
   "source": [
    "#项目10-例10-1代码\n",
    "#导入鸢尾花数据集\n",
    "from sklearn.datasets import load_iris\n",
    "from sklearn.preprocessing import StandardScaler #导入数据预处理类\n",
    "from sklearn.model_selection import train_test_split\n",
    "\n",
    "#提取花瓣长度与花瓣宽度作为特征变量\n",
    "x1,y=load_iris().data[:,2:4],load_iris().target  \n",
    "#数据标准化处理\n",
    "scaler=StandardScaler().fit(x1) #数据标准化\n",
    "x=scaler.transform(x1)#转换数据集\n",
    "#拆分数据集\n",
    "x_train,x_test,y_train,y_test=train_test_split(x,y,random_state=1,test_size=50) #将数据集拆分为训练集与测试集"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "da669ad8",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "模型评估报告：\n",
      "              precision    recall  f1-score   support\n",
      "\n",
      "           0       1.00      1.00      1.00        17\n",
      "           1       0.95      1.00      0.97        19\n",
      "           2       1.00      0.93      0.96        14\n",
      "\n",
      "    accuracy                           0.98        50\n",
      "   macro avg       0.98      0.98      0.98        50\n",
      "weighted avg       0.98      0.98      0.98        50\n",
      "\n"
     ]
    }
   ],
   "source": [
    "\n",
    "from sklearn.neural_network import MLPClassifier\n",
    "from sklearn.metrics import classification_report\n",
    "#模型训练\n",
    "model=MLPClassifier(solver='lbfgs',activation='logistic',max_iter=1000,random_state=1)\n",
    "model.fit(x_train,y_train)\n",
    "\n",
    "#模型评估\n",
    "re=classification_report(y_test,model.predict(x_test))\n",
    "print('模型评估报告：')\n",
    "print(re)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "7c33a9cb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAEECAYAAAArlo9mAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGli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1dCxNurnCKZhXg4sEpGpba+LA18GngPeJSLbgaVDdbENVXq0PLJSB6mtBx/p9JtD9/3jCJbLexdB4D8FvEAwC+gcYLgx5ptFaq5SGvhKKVUudAxfKaXKhAa+UkqVCQ18pZQqExr4SilVJv4/aBpmZw/RBnoAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#使用Matplotlib绘制分类界面，显示分类结果\n",
    "import matplotlib.pyplot as plt\n",
    "from matplotlib.colors import ListedColormap\n",
    "import numpy as np\n",
    "#绘制分割区域\n",
    "x_min,x_max=x[:,0].min()-1,x[:,0].max()+1\t\t#寻找横坐标的范围\n",
    "y_min,y_max=x[:,1].min()-1,x[:,1].max()+1\t\t#寻找纵坐标的范围\n",
    "#在特征范围内以步长为0.02预测每个点的输出结果\n",
    "x1,x2=np.meshgrid(np.arange(x_min,x_max,0.02),np.arange(y_min,y_max,0.02))\t\t\t\t\t\n",
    "Z=model.predict(np.c_[x1.ravel(),x2.ravel()])\t#预测测试点的值\n",
    "Z=Z.reshape(x1.shape) \n",
    "iris_cmap=ListedColormap([\"#ACC6C0\",\"#FF8080\",\"#A0A0FF\"])\t\t\t\t#设置分类界面的颜色\n",
    "plt.pcolormesh(x1,x2,Z,cmap=iris_cmap)\t#绘制分类界面\n",
    "#绘制散点图\n",
    "plt.scatter(x[:,0],x[:,1],c=y)\n",
    "#设置坐标轴的名称并显示图形\n",
    "plt.rcParams['font.sans-serif']='Simhei'\t#中文文字设置为黑体\n",
    "plt.rcParams['axes.unicode_minus']=False\t\t#解决负号显示不正常的问题\n",
    "plt.xlabel('花瓣长度')\t\t\t\t\t\t#图形横轴的标签名称\n",
    "plt.ylabel('花瓣宽度')\t\t\t\t\t\t#图形纵轴的标签名称\n",
    "plt.show()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c936fffb",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "542b71e1",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
